﻿using System.Collections.Generic;

namespace cz.muni.fi.pb138
{
	/// <summary>
	/// an interface of a Media Manager that provides all the necessarry functions for managing Media.
	/// </summary>
    public interface IMediaManager
    {
		/// <summary>
		/// adds new media to the database and refreshes the media list.
		/// </summary>
		/// <param name="media">New media instance to be stored</param>
		/// <returns>created <c>Media</c></returns>
        Media CreateMedia(Media media);
		/// <summary>
		/// Updates media in the DB according to the given one
		/// </summary>
		/// <param name="media">a master according to which the media in DB is updated</param>
        void UpdateMedia(Media media);
		/// <summary>
		/// Removes certain media from the DB
		/// </summary>
		/// <param name="media">a Media to be removed</param>
        void RemoveMedia(Media media);
		/// <summary>
		/// Finds certain media in the DB
		/// </summary>
		/// <param name="id">the ID of a media to be found</param>
		/// <returns>the <c>Media</c> that was to be found or null</returns>
        Media FindMediaById(long id);
		/// <summary>
		/// Retrieves all media as <c>Media</c> from the database that contain a phrase given in the name parameter
		/// </summary>
		/// <param name="name">string that is searched for in media's original name</param>
		/// <returns>list containing all the media that contain the given string</returns>
        IList<Media> FindMediaByName(string name);
		/// <summary>
		/// Retrieves all media from the database
		/// </summary>
		/// <returns>list containing all found media</returns>
        List<Media> FindAllMedias();
    }
}
